package com.sundablog.service.impl.systemsetup.basicsetup.websitesettings;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sundablog.mapper.WebSiteSettingsMapper;
import com.sundablog.pojo.WebSiteSettings;
import com.sundablog.pojo.WebSiteSettingsExample;
import com.sundablog.service.systemsetup.basicsetup.websitesettings.WebSiteSettingsService;

/**
 * 网站设置接口实现类
 * @ClassName:  WebSiteSettingsServiceImpl   
 * @Description:TODO(这里用一句话描述这个类的作用)   
 * @author: 哒哒 
 * @date:   2017年12月21日 下午11:33:09   
 *     
 * @Copyright: 2017 www.sundablog.com Inc. All rights reserved.
 */
@Service
public class WebSiteSettingsServiceImpl implements WebSiteSettingsService {

	
	@Autowired
	private WebSiteSettingsMapper webSiteSettingsMapper;
	
	
	/**
	 * 获取一条网站设置(注意数据库就一条)
	 * @Title: selectWebSiteSettings   
	 * @Description: TODO(这里用一句话描述这个方法的作用)   
	 * @param: @return      
	 * @return: WebSiteSettings      
	 * @throws
	 */
	@Override
	public WebSiteSettings getWebSiteSettings() {
		WebSiteSettingsExample example = new WebSiteSettingsExample();
		List<WebSiteSettings> list = webSiteSettingsMapper.selectByExample(example);
		return list.get(0);
	}

	/**
	 * 修改网站设置数据
	 * @Title: updateWebSiteSettings   
	 * @Description: TODO(这里用一句话描述这个方法的作用)   
	 * @param: @param webSiteSettings
	 * @param: @return      
	 * @return: int      
	 * @throws
	 */
	@Override
	public int updateWebSiteSettings(WebSiteSettings webSiteSettings) {
		int i = webSiteSettingsMapper.updateByPrimaryKey(webSiteSettings);
		return i;
	}

}
